<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateLuckMoneyRulesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('luck_money_rules', function (Blueprint $table) {
            $table->increments('id');
            $table->string('city', 50)->comment('城市码');
            $table->date('sdate')->comment('开始日期');
            $table->date('edate')->comment('结束日期');
            $table->time('stime')->comment('开始时间');
            $table->time('etime')->comment('结束时间');
            $table->integer('is_on')->comment('是否开启')->default(0);
            $table->integer('daily_user_upper')->comment('单用户每日上限（分）');
            $table->integer('total_upper')->comment('上限金额（分）');
            $table->integer('current_amount')->comment('当前总额（分）')->default(0);
            $table->integer('interval')->comment('触发间隔（秒）');
            $table->integer('min_amount')->comment('最小金额');

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('luck_money_rules');
    }
}
